#include"BinarySearchTree.hpp"

int main()
{
    int arr[] = { 3,6,7,8,9,1,2,5,7,1,3,4 };

    BinarySearchTree<int> bstree;

    for (auto a : arr)
    {
        bstree.Insert_Rcs(a);
    }
    bstree.InOrder();

    for(auto a:arr)
    {
        cout<<bstree.Find_Rcs(a)<<" ";
    }
    cout<<endl;
    // int result[] = { 1,2,3,4,5,6,7,8,9 };
    // for (auto e : result)
    // {
    //     bstree.Erase_Rcs(e);
    // }
    
    // bstree.InOrder();

    BinarySearchTree<int> buf(bstree);
    buf.Insert(666);
    cout<<"buffer:";
    buf.InOrder();

    bstree=buf;
    cout<<"new bstree:";
    bstree.InOrder();

    //bstree.Destroy_Rcs();

    return 0;
}